import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import p001 from './p001';
import p002 from './p002';
import p003 from './p003';
interface Iparam extends Event {
	page_no: number;
}

export default async function a003(fd: IFeidaoAiBrowserComponent, e: Iparam) {
	// 行业领域分页跳转
	// console.log(args);
	const d = fd.data.node.querySelector<HTMLInputElement>('[data-name="name1"]');
	const v = d.value;

	const page_no = e.page_no;
	const res = await nodejs<{ res: Array<{}>; c: number; }>('customer-care/zj-000003/s001', {
		industry_domain_name: v,
		page_no
	});
	console.info(res);
	if (res.res.length > 0) {
		render(fd, res.res, p001, 'p001', 'inner');
		render(fd, { page_no, total: res.c }, p002, 'p002', 'inner');
	} else {
		render(fd, '', p003, 'p003', 'inner');
	}


}
